import { ref } from 'vue'
import { defineStore } from 'pinia'
import { RequestAxios } from '@/utils/axios'


export const useFocusListInfoStore = defineStore('focusListInfo', () => {
    const focusList = ref([] as IFansOrFocusData[])
    const focusTextList = ref<string[]>([])
    const switchFocusList = ref<boolean[]>([])

      const getFocusList = async (path: string, page: number) => {
        const res = await RequestAxios<IListRes>({
          url: path,
          method: 'get',
          params: {
            page: page,
            per_page: 100
          }
        })
        focusList.value = res.data.data.results
        focusList.value.forEach(() => {
          focusTextList.value.push("取消关注")
          switchFocusList.value.push(false)
        })
      }

      getFocusList('v1_0/user/followings', 1)

  return {focusList, focusTextList, switchFocusList }
})